// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import goods from './components/goods/goods';
import ratings from './components/ratings/ratings';
import seller from './components/seller/seller';
import './common/scss/index.scss';

Vue.use(VueRouter);//使用vue.use明确的安装路由功能
Vue.use(VueResource);
// let app = Vue.extend(App); //生成app对象

const routes = [
    
    { path: '/goods', component: goods },
    { path: '/ratings', component: ratings },
    { path: '/seller', component: seller },
    { path: '*', component: goods }
  ];
let router = new VueRouter ({
  routes
});//实例化一个router

// router.map({    //配置路由
//     '/goods': {
//       component: goods
//     },
//     '/ratings': {
//       component: ratings
//     },
//     '/seller': {
//       component: seller
//     }
// }); 
new Vue({
  el: '#app',
  router,
  ...App
});
// router.start(app,"#app");

